import { Component } from '@angular/core';
import { NavController, App } from 'ionic-angular';
import { SalesPage } from './sales/sales';
import { TabsPage } from '../tabs/tabs';
import { LoginPage } from '../login/login';
import { AddPage } from './add/add';
import { HandsetPage } from './handset/handset';
import { OrderPage } from './order/order';
import { SettingPage } from './setting/setting';
import { CustomerPage } from './customer/customer';
import { StorageProvider } from '../../providers/storage/storage';


@Component({
  selector: 'page-mine',
  templateUrl: 'mine.html'
})
export class MinePage {



  constructor(
    public navCtrl: NavController,
    public app: App,
    public storage: StorageProvider
  ) {

  }

  sales(page) {
    this.navCtrl.push(SalesPage)
  }
  add() {
    this.navCtrl.push(AddPage)
  }
  handset() {
    this.navCtrl.push(HandsetPage)
  }
  order() {
    this.navCtrl.push(OrderPage)
  }
  customer() {
    this.navCtrl.push(CustomerPage)
  }
  setting() {
    this.navCtrl.push(SettingPage)
  }
  loginOut() {
    this.storage.remove('User');
    document.location.reload();
    this.app.getRootNav().setRoot(LoginPage);
  }
}
